package com.mydroidchat.data.net;

import com.mydroidchat.data.Util;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * Created by IntelliJ IDEA.
 * User: Kadavr
 * Date: 04.01.12
 * Time: 20:22
 * To change this template use File | Settings | File Templates.
 */
public class LoginApiRequest extends ApiRequest<LoginApiResponse> {
    private String login;
    private String password;

    public LoginApiRequest(String login, String password) {
        this.login = login;
        this.password = password;
    }

    @Override
    protected URL createUrl() throws MalformedURLException {
        return new URL(Util.URL_START + "?act=auth&login=" + login + "&pass=" + Util.getMd5Hash(password));
    }

    @Override
    protected LoginApiResponse createResponse(String completePage) {
        return new LoginApiResponse(completePage);
    }
}
